{if count($gifts)>0}
{loop $gifts $item}
<tr>
    <td>
        <input type='checkbox'  value="{$item['id']}"/>
    </td>
    <td style='text-align:center;'>
        {ifp 'sale.gift.edit'}
        <a href='javascript:;' data-toggle='ajaxEdit' data-href="{php echo webUrl('sale/gift/change',array('typechange'=>'displayorder','id'=>$item['id']))}" >{$item['displayorder']}</a>
        {else}
        {$item['displayorder']}
        {/if}
    </td>
    <td>
        <img src="{php echo tomedia($item['thumb'])}" style="width:40px;height:40px;padding:1px;border:1px solid #ccc;"  />
    </td>
    <td class='full' style="overflow-x: hidden">
        {ifp 'sale.gift.edit'}
        <a href='javascript:;' data-toggle='ajaxEdit' data-href="{php echo webUrl('sale/gift/change',array('typechange'=>'title','id'=>$item['id']))}" >{$item['title']}</a>
        {else}
        {$item['title']}
        {/if}
    </td>
    <td  style="overflow:visible;">
        <span class='label {if $item['status']==1}label-success{else}label-default{/if}'
        {ifp 'sale.gift.edit'}
        data-toggle='ajaxSwitch'
        data-confirm = "确认是{if $item['status']==1}关闭{else}开启{/if}？"
        data-switch-refresh='true'
        data-switch-value='{$item['status']}'
        data-switch-value0='0|关闭|label label-default|{php echo webUrl('sale/gift/status',array('status'=>1,'id'=>$item['id']))}'
        data-switch-value1='1|开启|label label-success|{php echo webUrl('sale/gift/status',array('status'=>0,'id'=>$item['id']))}'
        {/if}>
        {if $item['status']==1}开启{else}关闭{/if}</span>
    </td>
    <td  style="overflow:visible;position:relative;text-align: right;">
        {ifp 'sale.gift.edit|sale.gift.view'}
        <a  class='btn btn-default btn-sm' href="{php echo webUrl('sale/gift/edit', array('type'=>$_GPC['type'],'id' => $item['id'],'page'=>$page))}" title="{ifp 'sale.gift.edit'}编辑{else}查看{/if}">
            <i class='fa fa-edit'></i> {ifp 'sale.gift.edit'}编辑{else}查看{/if}
        </a>
        {/if}
        {ifp 'sale.gift.delete1'}
        <a  class='btn btn-default btn-sm' data-toggle='ajaxRemove' href="{php echo webUrl('sale/gift/delete1', array('id' => $item['id']))}" data-confirm='如果此活动存在购买记录，会无法关联到商品, 确认要彻底删除吗?？'><i class='fa fa-remove'></i> 彻底删除</a>
        {/if}
    </td>
</tr>
<tr>
    <td colspan='3' style='text-align: left;border-top:none;padding:5px 0;' class='aops'>
        {if !empty($item['merchname']) && $item['merchid'] > 0}
        <span class="text-default" style="margin-left: 95px;">商户名称:</span><span class="text-info">{$item['merchname']}</span>
        {/if}
    </td>

    <td colspan='3' style='text-align: right;border-top:none;padding:5px 0;' class='aops'></td>
</tr>
{/loop}
{else}
<td colspan="6" style="text-align: center;">暂时没有任何赠品!</td>
{/if}